Skip to content

Bugfixes - #95

Merged
DominicOram merged 3 commits into
mainfrom
fix_bugs
Aug 20, 2026
Merged

Bugfixes#95
DominicOram merged 3 commits into
mainfrom
fix_bugs

Conversation

@jacob-williamson

@jacob-williamson jacob-williamson commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Bugs:

  • After restoring contents after a failed _sync, self._queue was pointing to the same object as self._last_good_contents["queue"] same for queue_history etc. This meant that self._last_good_contents from then on changed whenever self._queue changed, defeating its whole purpose. Fixed by doing a deepcopy
  • i15-1: The queue converter now expects experiment definitions to have a time_per_pdf field, but the background scans inserted by the plugin didn't populate this field. Have added this in based on the max time_per_pdf in the queue, and a test that would have caught this

Also adds some more logging that was helpful when debugging the above

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.88%. Comparing base (28e8839) to head (da7274f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #95   +/-   ##
=======================================
  Coverage   98.87%   98.88%           
=======================================
  Files          20       20           
  Lines         976      984    +8     
=======================================
+ Hits          965      973    +8     
  Misses         11       11           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Some comments in code. I also think the logic could be better. For _get_required_backgrounds we actually need a background where the time_per_pdf is > experiment.time_per_pdf. By working out exactly what the max_time_per_pdf is upfront and saying we need exactly that we lean more heavily on the assumption that everything is queued at once (which is a valid assumption right now but we should try and not use it as much as possible). I think the logic instead should be, something like:

for task in task:
    if tiled_background.time > task.time:
        task.background = tiled_background
    else:
        backgrounds.append(get_required_backgrounds(task))

actual_background = backgrounds[0]
for potential_background in backgrounds:
    if potential_background.time > actual_background.time:
        actual_background = potential_background

This obviously gets more complex again when we add different capillaries/temps but I think the general pattern of :

  1. Go through all the tasks and assign them tiled backgrounds if appropriate, otherwise make a set of backgrounds they would need
  2. Go through these backgrounds and sanitise them

makes sense

name="background_scan", id="", data={"background": background}
name="background_scan",
id="",
data={"background": background, "time_per_pdf": 10},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: Should this not be

Suggested change
data={"background": background, "time_per_pdf": 10},
data={"background": background, "time_per_pdf": background.time_per_pdf},

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good spot thanks

if isinstance(task.experiment, Experiment)
and "time_per_pdf" in task.experiment.experiment_definition.data
]
max_time_per_pdf = max(pdf_times) if pdf_times else 10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: I think there not being pdf_times is probably an error

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I'll let it KeyError, once we get the types from the graph schema we can validate the whole data dict

@jacob-williamson

jacob-williamson commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

Rest of the comments should be covered by #80

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@DominicOram
DominicOram merged commit eabe54e into main Aug 20, 2026
12 checks passed
@DominicOram
DominicOram deleted the fix_bugs branch August 20, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants